<?php
/*
 * Action class action for approve users after create(only super admin  can perfom this operation )
 * @author Chamara Bandara
 * @copyright Copyright &copy; 2011 Allion Technologies (Pvt) Ltd
 */

class ApproveAction extends CAction {

   public function run() {
      $controller = $this->getController();
      $model = new User();
      if (isset($_GET['id']))
         User::model()->updateAll(array('status' => "Active"), 'id="' . $_GET['id'] . '"');
      $model->unsetAttributes();
      $model = new User();
      $controller->redirect('?r=/user/admin', array(
          'model' => $model,
      ));
   }
}